<?php
/**
 * Created by PhpStorm.
 * User: spatra
 * Date: 14-11-7
 * Time: 下午10:57
 */

namespace Libraries;

use Illuminate\Routing\Route;
use Illuminate\Http\Request;


class RoleHelper
{
    public function filter(Route $route, Request $request)
    {
        $currRole = \Auth::user()->role;
        $currRoleNamespace = studly_case($currRole->name);

        $boundControllers = ['LessonController', 'LessonStudentController'];

        foreach( $boundControllers as $currController){
            \App::bind($currController, $currRoleNamespace. '\\'. $currController);
        }
    }
}